package com.hex.ds.hdtp.core.inf.metadata.converter;

import com.hex.ds.hdtp.core.inf.metadata.entity.TableFieldsEntity;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

import java.util.Map;

/**
 * @Description: mysql sql的结果转对象
 * @Package: com.hex.hdc.service.source.mysql.mapper
 * @ClassName: IMysqlListBeanMapper
 *
 * @Author: xiaoma
 * @Date: 2022/5/23 14:24
 * @Version: v1.0
 **/
@Mapper(componentModel = "spring")
public interface IMysqlSqlResultMapper {

    @Mapping(source = "ORDINAL_POSITION", target = "columnId")
    @Mapping(source = "COLUMN_NAME", target = "columnName")
    @Mapping(source = "DATA_TYPE", target = "columnType")
    @Mapping(source = "COLUMN_COMMENT", target = "columnCommet")
    @Mapping(source = "TABLE_SCHEMA", target = "dataBaseName")
    @Mapping(source = "TABLE_NAME", target = "tableName")
    @Mapping(source = "TABLE_COMMENT", target = "tableCommet")
    TableFieldsEntity toTableFieldsBean(Map<String, String> sqlResult);
}
